#import <UIKit/UIKit.h>
#import "SFUEvent.h"
#import "SFUConstants.h"
#import "EventViewerDelegate.h"

/**
 * An EventViewer is an object representing the view that 
 * displays information regarding a given SFU event.
 *
 * An EventViewerDelegate must be set to respond to events from
 * within the event viewer.
 *
 * Conforms to UIScrollViewDelegate protocol.
 *
 * @author      James Lin
 * @version     0.7.4
 * @since       0.2.0
 * @see         UIScrollViewDelegate
 * @see         EventViewerDelegate
 */
@interface EventViewer : UIViewController <UIScrollViewDelegate> {
	id<EventViewerDelegate> delegate;       // Delegate handling events
	UIScrollView*           eventInfoView;  // The scrollable event view
	UIView*                 zoomableView;   // The label content view
	CGFloat                 contentHeight;  // Height of all view content
	SFUEvent*               eventInfo;      // SFU event to display
	UINavigationController* parentNav;      // The parent navigation controller
	UIButton*               locationButton; // Button to view location on map
	BOOL                    isTemporary;    // Whether the event is temporary
}

@property (nonatomic, retain) SFUEvent* eventInfo;

/**
 * Retrieve the shared instance of the event viewer.
 *
 * @return  the shared instance of EventViewer
 */
+ (EventViewer*)sharedEventViewer;

/**
 * Get the delegate handling events from the event viewer.
 *
 * @return  the delegate handling events from event view
 * @see     EventViewerDelegate
 */
- (id<EventViewerDelegate>)delegate;

/**
 * Set the delegate handling events from the event viewer.
 *
 * param theDelegate  the delegate handling events from event view
 * @see               EventViewerDelegate
 */
- (void)setDelegate:(id<EventViewerDelegate>)theDelegate;

/**
 * Display the event information in a new view.
 *
 * Pushes this view onto the navigation controller stack of the parent
 * view. Upon tapping the back button, the view is automatically 
 * popped off the top of the navigation stack.
 *
 * @param event          the event to display
 * @param temporary      whether the event to display is temporary
 * @param navController  the navigation controller of the parent view
 */
- (void)displayEvent:(SFUEvent*)event 
		 isTemporary:(BOOL)temporary
	   navController:(UINavigationController*)navController;

@end
